	
	<div id="page-content">
			<div class="col-lg-12">
		        <div class="panel">
		            <div class="panel-heading">
		                <h3 class="panel-title" style="text-align: right;">
		                	#@installPJaxGoBackBtn()
		                	爬取链接
		                </h3>
		            </div>
		            <form id="editForm" class="panel-body form-horizontal form-padding">
							<input type="hidden"  name="#(formModelName).id" class="form-control" value="#(o?o.id:'')">
							<div class="form-group">
			                    <label class="col-md-2 control-label">所属站点</label>
			                    <div class="col-md-5">
			                    	<div class="input-group mar-btm">
				                        <input type="hidden" id="website_id" name="#(formModelName).website_id" class="form-control" value="#(o?o.website_id:'')">
				                        <input type="text" id="website_name" class="form-control" disabled value="#(o?o.website_name:'')">
				                        <span class="input-group-btn">
				                            <button class="btn btn-primary" type="button" onclick="selectOneWebsite()">选择</button>
				                        </span>
			                    	</div>
			                        <small class="help-block">请选择所属单位</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">名称</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).name" class="form-control"  value="#(o?o.name:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入名称</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">类型</label>
			                    <div class="col-md-9">
			                    	<div style="padding: 6px;">
				                        <input id="radioButton1" class="magic-radio" type="radio" name="#(formModelName).type" value="1" #if(o&&o.type=="1") checked #end>
				                        <label for="radioButton1">普通地址</label>
				                        <input id="radioButton2" class="magic-radio" type="radio" name="#(formModelName).type" value="2" #if(o&&o.type=="2") checked #end>
				                        <label for="radioButton2">有分页地址</label>
				                    </div>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">爬取的地址</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).url" class="form-control"  value="#(o?o.url:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入爬取的地址</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">爬取实现类</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).getdata_impl_class" class="form-control"  value="#(o?o.getdata_impl_class:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入爬取实现类</small>
			                    </div>
			                </div>
		                	#if(view=='detail')
			                
				            #else
			            	<div class="panel-footer">
			                    <div class="row">
			                        <div class="col-sm-8 col-sm-offset-3">
			                            <button class="btn btn-warning" type="reset" #if(view=='detail') disabled #end>重置</button>
			                            <button class="btn btn-primary" type="submit" #if(view=='detail') disabled #end>保存</button>
			                        </div>
			                    </div>
			                </div>
				            #end
		            </form>
		        </div>
		    </div>
	</div>
	<script>
		function save(){
			var data = common_ajax.ajaxFunc("/admin/grap/url/save", $('#editForm').serialize(), "json", null);
			if(data.success){
				pointLion.alertMsg("保存成功!" , "success" , "small" , function(){
					location.href = ctx+'/admin/grap/url/getListPage';//跳转到列表页
				},data);
			}else{
				pointLion.alertMsg(data.message , "danger" , "small" , function(){
					$(".btn").removeAttr("disabled");
				},data);
			}
		}
		
		var selectOneWebsiteIframe;
		function selectOneWebsite(){
			layer.open({
				  type: 2,
				  title: false, //不显示标题栏
				  area: ['300px', '550px'],
				  shade: 0.2,
				  id: 'selectOneOrg', //设定一个id，防止重复弹出
				  resize: false,
				  closeBtn: false,
				  isOutAnim : false , 
				  btn: ['确定', '取消'], 
				  btnAlign: 'c',
				  content: ctx+'/admin/grap/website/selectOneWebsitePage',
				  success: function(layero){
						selectOneWebsiteIframe = window[layero.find('iframe')[0]['name']];
				  },
				  yes: function(){
					  var node = selectOneWebsiteIframe.getOneWebsiteData();
					  if(node){
						  $("#website_id").val(node.id);
						  $("#website_name").val(node.name);
					  }
					  layer.closeAll();
				  }
			});
		}
		$(document).ready(function() {
			$('#editForm').bootstrapValidator({
	            fields: {
	            }
	        }).on("success.form.bv", function (e) {
	            save();
	            return false;//阻止表单跳转
	        });
		});
	</script>